package com.group6.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * @author 张雨博
 * @TableName admission
 */
@TableName(value ="admission")
@Data
public class Admission implements Serializable {
    /**
     * 
     */
    @TableId(value = "AdmissionID", type = IdType.AUTO)
    private Integer admissionid;

    /**
     * 
     */
    @TableField(value = "PatientID")
    private Integer patientid;

    /**
     * 
     */
    @TableField(value = "AdmissionDate")
    private Date admissiondate;

    /**
     * 
     */
    @TableField(value = "DischargeDate")
    private Date dischargedate;

    /**
     * 
     */
    @TableField(value = "DepartmentID")
    private Integer departmentid;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Admission other = (Admission) that;
        return (this.getAdmissionid() == null ? other.getAdmissionid() == null : this.getAdmissionid().equals(other.getAdmissionid()))
            && (this.getPatientid() == null ? other.getPatientid() == null : this.getPatientid().equals(other.getPatientid()))
            && (this.getAdmissiondate() == null ? other.getAdmissiondate() == null : this.getAdmissiondate().equals(other.getAdmissiondate()))
            && (this.getDischargedate() == null ? other.getDischargedate() == null : this.getDischargedate().equals(other.getDischargedate()))
            && (this.getDepartmentid() == null ? other.getDepartmentid() == null : this.getDepartmentid().equals(other.getDepartmentid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getAdmissionid() == null) ? 0 : getAdmissionid().hashCode());
        result = prime * result + ((getPatientid() == null) ? 0 : getPatientid().hashCode());
        result = prime * result + ((getAdmissiondate() == null) ? 0 : getAdmissiondate().hashCode());
        result = prime * result + ((getDischargedate() == null) ? 0 : getDischargedate().hashCode());
        result = prime * result + ((getDepartmentid() == null) ? 0 : getDepartmentid().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", admissionid=").append(admissionid);
        sb.append(", patientid=").append(patientid);
        sb.append(", admissiondate=").append(admissiondate);
        sb.append(", dischargedate=").append(dischargedate);
        sb.append(", departmentid=").append(departmentid);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}